package org.lanqiao.controller;

import org.lanqiao.entity.Admin;
import org.lanqiao.service.AdminService;
import org.lanqiao.util.Result;
import org.lanqiao.util.SessionListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    AdminService adminService;

    /**
     * @Author 王宇
     * @Description //TODO 判断超管的账号密码是否正确
     * @Date 2019/05/22 17:15
     * @Param [adminAccout, adminPassword]
     * @return org.lanqiao.entity.Admin
     */

    @RequestMapping(value = "/getAdmins",produces = "application/json;charset:utf-8;")
    @ResponseBody
    public Result getAdmin(String adminAccout, String adminPassword){
        return adminService.getAdmin(adminAccout, adminPassword);
    }

    /**
     * @Author 王宇
     * @Description //TODO 超管退出
     * @Date 2019/06/17 17:08
     * @Param [userEmail]
     * @return org.lanqiao.util.Result
     */
    @RequestMapping(value = "/adminExit")
    @ResponseBody
    public Result adminExit(String adminAccout) {
        return adminService.adminExit(adminAccout);
    }
}
